import Antd from 'ant-design-vue'
import router from './router'
import store from './store'
import i18n from '@/locales/useI18n'
import SComponents from '@/components/extends'
import vuescroll from 'vuescroll'
import { GET, POST, DELETE, PUT } from '@/api/api.js'
import plugins from '@/plugins/index.js'
import { TOGGLE_LOADING } from '@/store/mutation-types'
export default (app) => {
  app.use(Antd)
  //引入antd
  app.use(router)
  app.use(vuescroll)
  app.use(store)
  app.use(i18n)
  app.use(router)
  app.use(plugins)
  //扩展组件
  app.use(SComponents)
  //接口调用入口
  app.config.globalProperties.$loading = function (flag) {
    store.commit(TOGGLE_LOADING, flag)
  }
  app.config.globalProperties.$api = {
    GET: GET,
    POST: POST,
    DELETE: DELETE,
    PUT: PUT
  }
  app.config.globalProperties.CODES = {
    SUCCESS: '000000'
  }
}
